﻿using System.Reflection;
using AbpLocalization.ApiHost.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;

namespace AbpLocalization.ApiHost // /AbpLocalization/ApiHost/Localization
{
    [DependsOn(
        typeof(AbpLocalizationModule)
        )]
    public class MyLocalizationModule:AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            Configure<AbpVirtualFileSystemOptions>(options =>
            {
                // "YourRootNameSpace" 是项目的根命名空间名字. 如果你的项目的根命名空间名字为空,则无需传递此参数.
                // "AbpLocalization.ApiHost.Localizations"
                options.FileSets.AddEmbedded<PerryLocalizationResource>("AbpLocalization.ApiHost");
            });

            Configure<AbpLocalizationOptions>(options =>
            {
                options.Resources
                    .Add<PerryLocalizationResource>("chinese")
                    .AddVirtualJson("/Localization");
            });
        }
    }
}
